package com.example.android.apis;



import java.util.ArrayList;
import java.util.concurrent.LinkedBlockingQueue;

import android.content.Context;
import android.graphics.Color;
import android.util.Log;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

public class NewsView extends LinearLayout 
{
	Context context;
	News news;
	ImageView image;
	TextView text;
	
	public static LinkedBlockingQueue<ImageView> lnews = new LinkedBlockingQueue<ImageView>();
	public static LinkedBlockingQueue<ImageView> tnews = new LinkedBlockingQueue<ImageView>();
	
	public NewsView(Context context,News news)
	{
		super(context);
		
		LayoutInflater inflater = (LayoutInflater)context.getSystemService(
				Context.LAYOUT_INFLATER_SERVICE);
		inflater.inflate(R.layout.newsview, this, true);
		this.context = context;
		this.news = news;
		text = (TextView) findViewById(R.id.newstext);
		text.setTextColor(Color.WHITE);
		text.setText(news.newstext);
		image = (ImageView)findViewById(R.id.newsicon);
		image.setImageBitmap(news.bit);
//		if(news.whichnews.equals("transfernews")) tnews.add(this.image);
//		else if(news.whichnews.equals("latestnews")) lnews.add(this.image);
//		else throw new RuntimeException("41");
//		
				
	}
	
	public void setNews(News news)
	{
		this.news = news;
	}
	
	public News getNews(){
		return news;
	}
}
